package shs.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller //适配 服务端渲染 前后端不分离模式
public class WelcomeController {

    @GetMapping("/wel")
    public String hello(@RequestParam("name") String name, Model model){
        //模板的逻辑视图地址
        //物理视图=前缀+逻辑视图名+后缀
        //真实地址=classpath:/templates/welcome.html
        model.addAttribute("msg",name);
        return "welcome";
    }
}
